home *** CD-ROM | disk | FTP | other *** search
/ Shareware Grab Bag / Shareware Grab Bag.iso / 007 / boosters.arc / RESTORES.ASM < prev    next >
Assembly Source File  |  1985-10-23  |  1KB  |  61 lines

  1. ;*************************************************
  2. ;
  3. ;       Procedure RestoreScreen (Var PAGE : HeapBuf);
  4. ;
  5. ;       Restores screen from heap location PAGE
  6. ;
  7. ;*************************************************
  8. RestoreS proc    near
  9.         push    bp
  10.     mov    bp,sp
  11.     push    ds
  12. ;
  13. ;*** Determine Video address
  14. ;
  15.     mov    bx,449h
  16.     xor    ax,ax
  17.     mov    ds,ax
  18.     mov    al,[bx]     ; fetch video type
  19.     cmp    al,7        ; monochrome = 7
  20.     jne    graphx
  21.     mov    dx,0B000h
  22.     jmp    c001
  23. graphx:
  24.     mov    dx,0B800h
  25. c001:   mov     es,dx
  26. ;
  27. ;*** Copy PAGE from heap to video memory
  28. ;
  29.     mov    si,[bp+4]
  30.     mov    ds,[bp+6]
  31.     xor    di,di
  32.     mov    cx,2000     ; length of move
  33.     cld
  34.     cmp    dx,0B800h    ; CGA?
  35.     je    cga        ; yes
  36. rep    movsw            ; monochrome move
  37.     jmp    done
  38. ;
  39. ;***    Modified move for color monitor
  40. ;
  41. CGA:
  42.     mov    dx,03DAh
  43. RT_OFF: in    al,dx        ; Wait for retrace
  44.     and    al,1000b    ; to begin . . .
  45.     jz    rt_off
  46.     dec    dx
  47.     dec    dx
  48.     mov    al,21h
  49.     out    dx,al        ; disable video
  50. rep    movsw            ; move page to screen
  51. ;
  52.     mov    al,29h
  53.     out    dx,al        ; enable video
  54. ;
  55. DONE:   pop     ds
  56.         mov     sp,bp
  57.         pop     bp
  58.     ret    4
  59. RestoreS endp
  60. ;
  61.